home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / games / nerak2.zip / JIMMY.SCR < prev    next >
Text File  |  1995-09-24  |  7KB  |  196 lines

  1. !
  2. ! Jimmy's Script.  Derived from the adventurer script, but modified to
  3. ! to handle the one character.
  4. !
  5. ! DESCRIPTION:  Jimmy is a young Dwarf.  He lives near a small town 
  6. ! and works at Joe's pub.  He is the player's friend and want's to
  7. ! go have some fun.  His TEXT block shows the following keywords:
  8. !
  9. !  0 : Hello   Hi! What are you up to? Going on a trip?                
  10. !  1 : Default Have I shown you my weapons?  I'm dying to use them!    
  11. !  2 : Weapons In the chest over there.. Let's go do something..       
  12. !  3 : Join    What are we waiting for.. Let's get the weapons..       
  13. !  4 : Chest   I keep the weapons in the chest.  We could get them!    
  14. !  5 : Get     If we go on a quest, we should get them.                
  15. !  6 : Quest   You know.. Go kill some monsters or something..         
  16. !  7 : King    I heard he was missing!  That might be a worthy quest!  
  17. !  8 : Queen   We could go talk to her in the Castle!                  
  18. !  9 : Castle  Where the King and the Queen live!                      
  19. ! 10 : Trip    You're not thinking of leaving without me, are you?     
  20. ! 11 : AdventurIt's a good time of the year to go look for adventure!  
  21. ! 12 : Job     Joe can find another bus boy.  Let's go questing!       
  22. ! 13 : Joe     You know I work at Joe's Pub during the summer!         
  23. ! 14 : Pub     Yes!                                                    
  24. ! 15 : Ship    I don't have one, but the Queen might lend us one!      
  25. !
  26. ! - V0 is TRUE when we've talked before.
  27. ! - V1 is TRUE if we've JOINED the group
  28. !
  29. ! (c) DC Software, 1992
  30. !
  31.  
  32. !------------------------------------------------------------------------!
  33. :@TALK ! START HERE WHEN YOU 'TALK' TO THIS CHARACTER !
  34. !------------------------------------------------------------------------!
  35.  
  36. ! First, say hello.. !
  37.  
  38.   if npc.picture >= 0 then
  39.     viewpcx(npc);
  40.   endif;
  41.  
  42.   loadtext( npc.text ); ! Get the NPC's text block !
  43.   loadvfl ( npc.voice ); ! Get the NPC's voice block !
  44.  
  45.   if NPC.V0 > 0 then
  46.     ! We've spoken before, so don't give the standard greeting..
  47.     writeln( "Hello again!  I thought you were gone.." );
  48.   else
  49.     ! First time we talk, so give the standard greeting..
  50.     if not dotext( "Hello" ) then
  51.       ! If the text block didn't have one, the following would be used..
  52.       writeln( "Hello ", player.name, ". What are you up to?" );
  53.     endif;
  54.   endif;
  55.  
  56.   NPC.V0 = 1; ! This variable indicates we've talked before (see above)
  57.  
  58. :CHAT
  59.   L3 = getstr("Name","Join","Bye");
  60.   if L3 = -1 goto CSTOP; 
  61.  
  62. ! Handle JOIN differently..
  63.   if L3 = 1 then 
  64.     if group.size = 6 then
  65.       writeln( "Hey! Your party is full! There's no place for me!" );
  66.       goto CHAT;
  67.     endif;
  68.     if npc.level > player.level + 4 then
  69.       ! Normal behaviour would be to decline until adventurer has more
  70.       ! experience, but Jimmy is a friend, so it doesn't apply
  71.       writeln( "Ok.  But you are inexperienced, so let me handle the tough" );
  72.       writeln( "problems.  You'd better take the better armor too.." );
  73.     endif;
  74.     if npc.level < player.level - 6 then
  75.       ! Normal behaviour would be to decline because the adventurer
  76.       ! has too much experience.  Encounters tend to be more serious
  77.       ! and inexperienced members get killed easily.  Again, since
  78.       ! Jimmy is a friend, we wave the restriction..
  79.       writeln( "You mean it?!  I don't have a lot of experience, but I learn" );
  80.       writeln( "very fast..  Thanks!" );
  81.     endif;
  82.     if NOT dotext( "JOIN" ) then
  83.       writeln( "What are we waiting for.. Let's get the weapons!" );
  84.     endif;
  85.     ! Now we might do some animation, so we restore the graphics !
  86.     ! to allow the player to see it !
  87.     if npc.picture >= 0 then
  88.       paint(window); ! Assumes the picture fits in the window !
  89.     endif;
  90.  
  91.     ! If were at the original location, and haven't joined yet.. !
  92.     if npc.v1 = FALSE and npc.x = 3 and npc.y = 7 then
  93.       L1 = 1; ! walk to the right.. !
  94.       for L0 = 1 to 4 do
  95.         gosub MOVEJIMMY;
  96.       endfor;
  97.       L2 = 0;
  98.       L1 = find( object, "Jimmy's Chest", CHEST );
  99.       if success then
  100.         object.index = L1;
  101.         writeln( "I have ", $object.value, " saved from my summer job.." );
  102.         inc( group.gold, object.value );
  103.         vanish(object);
  104.         pause(1); ! Use PAUSE instead of WAIT !
  105.       else
  106.         writeln( "I could have sworn I had some money in here.." );
  107.         inc(L2);
  108.       endif;
  109.       L1 = find( object, "Dwarf's Armor", armor );
  110.       if success then
  111.         object.index = L1;
  112.         writeln( "This Chain Mail is worn, but functional!" );
  113.         move( object, npc ); pause(1); ! Use PAUSE instead of WAIT !
  114.       else
  115.         writeln( "My chain mail is missing..  Hmm.." );
  116.         inc(L2);
  117.       endif;
  118.       L1 = find( object, "Dwarf's Axe", weapon );
  119.       if success then
  120.         object.index = L1;
  121.         writeln( "This Axe belonged to my brother..  It's heavy!" );
  122.         move( object, npc ); pause(1); ! Use PAUSE instead of WAIT !
  123.       else
  124.         writeln( "Where did I put that Axe?" );
  125.         inc(L2);
  126.       endif;
  127.       if L2 > 0 then
  128.         if L2 = 3 then
  129.           writeln( "I assume you already got my stuff" );
  130.         else
  131.           writeln( "Some of my stuff is missing, I assume you got it?" );
  132.         endif;
  133.         pause(1); ! Use PAUSE instead of WAIT !
  134.       endif;
  135.       L1 = -1; ! Walk to the left.. !
  136.       for L0 = 1 to 4 do
  137.         gosub MOVEJIMMY;
  138.       endfor;
  139.       npc.v1 = TRUE;
  140.     endif;
  141.     JOIN; 
  142.     STOP; ! We are done.. !
  143.  
  144. :MOVEJIMMY ! Subroutine to move jimmy left or right..
  145.     if group.y = npc.y and group.x = npc.x + L1 then
  146.       group.x = npc.x; ! Trade places with the group !
  147.     endif;
  148.     inc( npc.x, L1 );
  149.     pause(1); ! Use PAUSE instead of WAIT !
  150.     return;
  151.  
  152.   endif; ! End of JOIN !
  153.  
  154. ! First, see if the keyword typed is in the character's text block !
  155.   if dotext( S0 ) then
  156.     if L3 = 2 goto XSTOP; ! BYE !
  157.     goto CHAT;
  158.   endif;
  159.  
  160. ! It didn't, so try the predefined ones..
  161.   on L3 goto CNAME, CJOIN, CSTOP;
  162.  
  163. ! Nope, try a 'DEFAULT' line
  164.   if not dotext( "DEFAULT" ) then
  165.     writeln( "I don't know anything about that!" );
  166.   endif;
  167.   goto CHAT;
  168.  
  169. :CNAME
  170.   writeln( "What do you mean, what's my name? Jimmy, of course!" );
  171.   voice( "NAME" );
  172.   GOTO CHAT;
  173.  
  174. :CJOIN
  175.   ! WHAT? Should never happen !
  176.   GOTO CHAT;
  177.  
  178. :CSTOP
  179.   ! BYE was not found in the "text" block for Jimmy !
  180.   writeln( "Nice talking to you.." );
  181.   voice( "BYE" ); ! But the voice may be in the RSC file !
  182.   goto XSTOP;
  183.  
  184. ! Feel free to expand on this list.. !
  185.  
  186. !-----------------------------------------------------------------!
  187. ! All STOPs now lead here so the screen can be restored if needed !
  188. !-----------------------------------------------------------------!
  189. :XSTOP
  190.   if npc.picture >= 0 then
  191.     paint(window); ! Assumes the picture fits in the window !
  192.   endif;
  193.   STOP;
  194.  
  195.  
  196.